from typing import Optional, Union

from pydantic import BaseModel, Field


class Req(BaseModel):
    name: str = Field(description='名字')
    detail: Optional[str] = Field(description='详情')


class Create(BaseModel):
    name: str = Field(description='名字')
    uid: str = Field(description='UID')
    detail: Optional[str] = Field(description='详情')


class Res(BaseModel):

    id: int = Field(description='ID')
    state: int = Field(description='状态')
    name: str = Field(description='名字')
    uid: str = Field(description='UID')
    detail: str = Field(description='详情')


class Del(BaseModel):
    id: list[int] = Field(description='ID列表', default=[])


class Update(BaseModel):

    name: Optional[str] = Field(description='名字')
    uid: Optional[str] = Field(description='UID')
    detail: Optional[str] = Field(description='详情')


class UpdateState(BaseModel):
    state: int = Field(description='状态')


